package com.vpclub.dao;

import com.vpclub.bean.Employee;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author : leimingchao
 * @date Date : 2021年08月04日 22:17
 */
public interface EmployeeDao {

    /**
     *根据id查询员工
     * @return
     */
    Employee getEmployeeById(Integer id);

    Employee getEmpByIdAndEmpName(@Param(value = "id") Integer id, @Param(value = "empName")String empName);

    Employee getEmployeeByIdAndEmpName(Map<String,Object> map);



    /**
     * 更新员工
     * @param employee
     * @return
     */
    int updateEmployee(Employee employee);

    boolean deleteEmployee(Integer id);

    int insertEmployee(Employee employee);

    int insertEmployee2(Employee employee);


    List<Employee> getAllEmployee();

    /**
     * 列名作为key，列值作为value
     * @param id
     * @return
     */
    Map<String,Object> getEmployeeByIdReturnMap(Integer id);

    /**
     * key就是这个记录的主键，value就是这条记录封装好的对象
     * @return
     *
     *
     * @MapKey(value = "id"):把查询的记录的id的值作为key封装这个map
     */
    @MapKey(value = "id")
    Map<Integer,Employee> getAllEmployeeByIdReturnMap();
}
